<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>新增学生</title>
</head>
<body>
<h1>新增学生</h1>
<form th:action="@{/saveStudent}" th:object="${student}" method="post">
    姓名:
    <input type="text" th:field="*{name}">
    <span th:if="${#fields.hasErrors('name')}" th:errors="*{name}"></span><br>

    Java成绩:
    <input type="number" th:field="*{javaScore}">
    <span th:if="${#fields.hasErrors('javaScore')}" th:errors="*{javaScore}"></span><br>

    <button type="submit">保存</button>
</form>
<a href="/">返回首页</a>
</body>
</html>